<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link href="../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <link href="../css/back/style.css" rel="stylesheet">
    <script src="../js/vue.min.js"></script>
    <title>新增学员</title>
</head>
<body>
<div id="allContent">
    <div class="panel panel-warning addDiv" style="height: 500px; width: 500px">
        <div class="panel-heading">编辑文章</div>
        <div class="panel-body">
            <form method="post" id="addForm" action="../admin_article_update" enctype="multipart/form-data">
                <input type="hidden" name="id" v-model="article.id">
                <table class="addTable">
                    <tbody>
                    <tr>
                        <td>文章类型</td>
                        <td>
                            <select class="form-control" name="type">
                                <option value="驾考规则">驾考规则</option>
                                <option value="驾考技巧">驾考技巧</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>标题</td>
                        <td>
                            <input v-model="article.title" type="text" class="form-control" name="title" required>
                        </td>
                    </tr>
                    <tr>
                        <td>内容</td>
                        <td>
                            <textarea v-model="article.content" class="form-control" rows="9" name="content" required></textarea>
                        </td>
                    </tr>
                    <tr class="submitTR">
                        <td colspan="2" align="center">
                            <button type="submit" class="btn btn-success">提 交</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
</div>
<script>
    let url = "../admin_article_get";
    new Vue({
        el: '#allContent',
        data: {
            article: []
        },
        mounted: function () {
            self = this;
            url += decodeURI(location.search);
            fetch(url).then(function (response) {
                response.json().then(function (jsonObject) {
                    self.article = jsonObject.article;
                    console.log(jsonObject);
                }).catch(function (err) {
                    console.log("Fetch错误：" + err);
                })
            })
        }
    });
</script>
</body>
</html>